package de.andreavicentini.teatralia.generate;

import org.magiclabs.htmlx.*;
import de.andreavicentini.teatralia.pages.*;
import de.andreavicentini.teatralia.pages.repertoire.*;

public class LesungRenderer<T> implements IRenderer<T> {
  protected static String nl;
  public static synchronized LesungRenderer create(String lineSeparator)
  {
    nl = lineSeparator;
    LesungRenderer result = new LesungRenderer();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = NL;
  protected final String TEXT_3 = NL;
  protected final String TEXT_4 = NL + "<p>";
  protected final String TEXT_5 = "</p>" + NL + "</div>";
  protected final String TEXT_6 = NL;

	public String generate(TeatraliaPage page, T argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
     
Lesung lesung = (Lesung) argument;
 
    stringBuffer.append(TEXT_2);
    stringBuffer.append(TEXT_3);
    stringBuffer.append( new ToggleHeader(lesung.hashCode() + "", lesung.getTitle(), "lesung") );
    stringBuffer.append(TEXT_4);
    stringBuffer.append( page.getText(lesung.getDescription()) );
    stringBuffer.append(TEXT_5);
    stringBuffer.append(TEXT_6);
    return stringBuffer.toString();
  }
}